<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Gem::Dependency - rubygems: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-3C-3D-3E">#&lt;=&gt;</a>
    <li ><a href="#method-i-3D-3D-3D">#===</a>
    <li ><a href="#method-i-3D~">#=~</a>
    <li ><a href="#method-i-identity">#identity</a>
    <li ><a href="#method-i-latest_version-3F">#latest_version?</a>
    <li ><a href="#method-i-match-3F">#match?</a>
    <li ><a href="#method-i-matches_spec-3F">#matches_spec?</a>
    <li ><a href="#method-i-matching_specs">#matching_specs</a>
    <li ><a href="#method-i-merge">#merge</a>
    <li ><a href="#method-i-prerelease-3F">#prerelease?</a>
    <li ><a href="#method-i-prioritizes_bundler-3F">#prioritizes_bundler?</a>
    <li ><a href="#method-i-requirement">#requirement</a>
    <li ><a href="#method-i-requirements_list">#requirements_list</a>
    <li ><a href="#method-i-runtime-3F">#runtime?</a>
    <li ><a href="#method-i-specific-3F">#specific?</a>
    <li ><a href="#method-i-to_spec">#to_spec</a>
    <li ><a href="#method-i-to_specs">#to_specs</a>
    <li ><a href="#method-i-type">#type</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Gem::Dependency">
    <h1 id="class-Gem::Dependency" class="class">
      class Gem::Dependency
    </h1>

    <section class="description">
    
<p>The <a href="Dependency.html"><code>Dependency</code></a> class holds a <a href="../Gem.html"><code>Gem</code></a> name and a <a href="Requirement.html"><code>Gem::Requirement</code></a>.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="TYPES">TYPES
          <dd><p>Valid dependency types.</p>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">name</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p><a href="Dependency.html"><code>Dependency</code></a> name or regular expression.</p>
              </div>
            </div>
          <div id="attribute-i-prerelease" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prerelease</span><span
                class="attribute-access-type">[W]</span>
            </div>

            <div class="method-description">
              <p>Allows you to force this dependency to be a prerelease.</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(name, *requirements)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Constructs a dependency with <code>name</code> and <code>requirements</code>. The last argument can optionally be the dependency type, which defaults to <code>:runtime</code>.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 36</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">requirements</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># ok</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Regexp</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">msg</span> = [<span class="ruby-string">&quot;NOTE: Dependency.new w/ a regexp is deprecated.&quot;</span>,
           <span class="ruby-node">&quot;Dependency.new called from #{Gem.location_of_caller.join(&quot;:&quot;)}&quot;</span>]
    <span class="ruby-identifier">warn</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Deprecate</span>.<span class="ruby-identifier">skip</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
          <span class="ruby-node">&quot;dependency name must be a String, was #{name.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">type</span>         = <span class="ruby-constant">Symbol</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> <span class="ruby-value">:runtime</span>
  <span class="ruby-identifier">requirements</span> = <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">first</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">requirements</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-comment"># unpack</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-constant">TYPES</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Valid types are #{TYPES.inspect}, &quot;</span> \
                         <span class="ruby-node">&quot;not #{type.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@name</span>        = <span class="ruby-identifier">name</span>
  <span class="ruby-ivar">@requirement</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">create</span> <span class="ruby-identifier">requirements</span>
  <span class="ruby-ivar">@type</span>        = <span class="ruby-identifier">type</span>
  <span class="ruby-ivar">@prerelease</span>  = <span class="ruby-keyword">false</span>

  <span class="ruby-comment"># This is for Marshal backwards compatibility. See the comments in</span>
  <span class="ruby-comment"># +requirement+ for the dirty details.</span>

  <span class="ruby-ivar">@version_requirements</span> = <span class="ruby-ivar">@requirement</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3C-3D-3E" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">&lt;=&gt;</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Dependencies are ordered by name.</p>

                              <div class="method-source-code" id="3C-3D-3E-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 178</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">&lt;=&gt;</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-identifier">name</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-3D-3D-3D" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">===</span><span
                                class="method-args">(other)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Dependency.html#method-i-3D~">=~</a>
                            </div>
                          </div>

                  <div id="method-i-3D~" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">=~</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Uses this dependency as a pattern to compare to <code>other</code>. This dependency will match if the name matches the other’s name, and other has only an equal version requirement that satisfies this dependency.</p>

                              <div class="method-source-code" id="3D~-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">=~</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">other</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:name</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:version</span>)
    <span class="ruby-identifier">other</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">other</span>.<span class="ruby-identifier">version</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span>

  <span class="ruby-identifier">reqs</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">requirements</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">reqs</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">reqs</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;=&quot;</span>

  <span class="ruby-identifier">version</span> = <span class="ruby-identifier">reqs</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">last</span>

  <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">satisfied_by?</span> <span class="ruby-identifier">version</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Dependency.html#method-i-3D-3D-3D">===</a>
                            </div>

                          </div>

                  <div id="method-i-identity" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">identity</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="identity-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 339</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">identity</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">prerelease?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">specific?</span>
      <span class="ruby-value">:complete</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-value">:abs_latest</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">latest_version?</span>
    <span class="ruby-value">:latest</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-value">:released</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-latest_version-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">latest_version?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Is this dependency simply asking for the latest version of a gem?</p>

                              <div class="method-source-code" id="latest_version-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 94</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">latest_version?</span>
  <span class="ruby-ivar">@requirement</span>.<span class="ruby-identifier">none?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-match-3F" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          match? name          &rarr; true or false
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          match? name, version &rarr; true or false
                              </span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          match? spec          &rarr; true or false
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Does this dependency match the specification described by <code>name</code> and <code>version</code> or match <code>spec</code>?</p>

<p>NOTE:  Unlike <a href="Dependency.html#method-i-matches_spec-3F"><code>matches_spec?</code></a> this method does not return true when the version is a prerelease version unless this is a prerelease dependency.</p>

                              <div class="method-source-code" id="match-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 220</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match?</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">version</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">allow_prerelease</span>=<span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">version</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">name</span>
    <span class="ruby-identifier">version</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">version</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">name</span>

  <span class="ruby-identifier">version</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Version</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">version</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">none?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">version</span>.<span class="ruby-identifier">prerelease?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">version</span>.<span class="ruby-identifier">prerelease?</span> <span class="ruby-operator">&amp;&amp;</span>
                  <span class="ruby-operator">!</span><span class="ruby-identifier">allow_prerelease</span> <span class="ruby-operator">&amp;&amp;</span>
                  <span class="ruby-operator">!</span><span class="ruby-identifier">prerelease?</span>

  <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">satisfied_by?</span> <span class="ruby-identifier">version</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-matches_spec-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">matches_spec?</span><span
                                class="method-args">(spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Does this dependency match <code>spec</code>?</p>

<p>NOTE:  This is not a convenience method.  Unlike <a href="Dependency.html#method-i-match-3F"><code>match?</code></a> this method returns true when <code>spec</code> is a prerelease version even if this dependency is not a prerelease dependency.</p>

                              <div class="method-source-code" id="matches_spec-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 247</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">matches_spec?</span>(<span class="ruby-identifier">spec</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>  <span class="ruby-keyword">if</span> <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">none?</span>

  <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">satisfied_by?</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">version</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-matching_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">matching_specs</span><span
                                class="method-args">(platform_only = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="matching_specs-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 273</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">matching_specs</span>(<span class="ruby-identifier">platform_only</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">env_req</span> = <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">env_requirement</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">matches</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">stubs_for</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">satisfied_by?</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">version</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">env_req</span>.<span class="ruby-identifier">satisfied_by?</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">version</span>)
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:to_spec</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">prioritizes_bundler?</span>
    <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;bundler_version_finder&quot;</span>
    <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">BundlerVersionFinder</span>.<span class="ruby-identifier">prioritize!</span>(<span class="ruby-identifier">matches</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">platform_only</span>
    <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">reject!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>.<span class="ruby-identifier">match_spec?</span>(<span class="ruby-identifier">spec</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">matches</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-merge" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">merge</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Merges the requirements of <code>other</code> into this dependency</p>

                              <div class="method-source-code" id="merge-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 257</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">merge</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>,
          <span class="ruby-node">&quot;#{self} and #{other} have different names&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">default</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>
  <span class="ruby-identifier">self_req</span> = <span class="ruby-identifier">requirement</span>
  <span class="ruby-identifier">other_req</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">requirement</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">self_req</span>  <span class="ruby-keyword">if</span> <span class="ruby-identifier">other_req</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">default</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">other_req</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">self_req</span>  <span class="ruby-operator">==</span> <span class="ruby-identifier">default</span>

  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">self_req</span>.<span class="ruby-identifier">as_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">other_req</span>.<span class="ruby-identifier">as_list</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prerelease-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prerelease?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Does this dependency require a prerelease?</p>

                              <div class="method-source-code" id="prerelease-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 86</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prerelease?</span>
  <span class="ruby-ivar">@prerelease</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">prerelease?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prioritizes_bundler-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prioritizes_bundler?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="prioritizes_bundler-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 300</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prioritizes_bundler?</span>
  <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;bundler&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">specific?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-requirement" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">requirement</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>What does this dependency require?</p>

                              <div class="method-source-code" id="requirement-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 116</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requirement</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@requirement</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@requirement</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@requirement</span>

  <span class="ruby-comment"># @version_requirements and @version_requirement are legacy ivar</span>
  <span class="ruby-comment"># names, and supported here because older gems need to keep</span>
  <span class="ruby-comment"># working and Dependency doesn&#39;t implement marshal_dump and</span>
  <span class="ruby-comment"># marshal_load. In a happier world, this would be an</span>
  <span class="ruby-comment"># attr_accessor. The horrifying instance_variable_get you see</span>
  <span class="ruby-comment"># below is also the legacy of some old restructurings.</span>
  <span class="ruby-comment">#</span>
  <span class="ruby-comment"># Note also that because of backwards compatibility (loading new</span>
  <span class="ruby-comment"># gems in an old RubyGems installation), we can&#39;t add explicit</span>
  <span class="ruby-comment"># marshaling to this class until we want to make a big</span>
  <span class="ruby-comment"># break. Maybe 2.0.</span>
  <span class="ruby-comment">#</span>
  <span class="ruby-comment"># Children, define explicit marshal and unmarshal behavior for</span>
  <span class="ruby-comment"># public classes. Marshal formats are part of your public API.</span>

  <span class="ruby-comment"># REFACTOR: See above</span>

  <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@version_requirement</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@version_requirement</span>
    <span class="ruby-identifier">version</span> = <span class="ruby-ivar">@version_requirement</span>.<span class="ruby-identifier">instance_variable_get</span> <span class="ruby-value">:@version</span>
    <span class="ruby-ivar">@version_requirement</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-ivar">@version_requirements</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">version</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@requirement</span> = <span class="ruby-ivar">@version_requirements</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@version_requirements</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-requirements_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">requirements_list</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="requirements_list-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">requirements_list</span>
  <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">as_list</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-runtime-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">runtime?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="runtime-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 164</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">runtime?</span>
  <span class="ruby-ivar">@type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:runtime</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@type</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specific-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specific?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>True if the dependency will not always match the latest version.</p>

                              <div class="method-source-code" id="specific-3F-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 296</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specific?</span>
  <span class="ruby-ivar">@requirement</span>.<span class="ruby-identifier">specific?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_spec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_spec</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_spec-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 324</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_spec</span>
  <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">to_specs</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-identifier">active</span> = <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">find</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:activated?</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">active</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">active</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">prerelease?</span>
    <span class="ruby-comment"># Move prereleases to the end of the list for &gt;= 0 requirements</span>
    <span class="ruby-identifier">pre</span>, <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">partition</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">version</span>.<span class="ruby-identifier">prerelease?</span> }
    <span class="ruby-identifier">matches</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">pre</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">requirement</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">first</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_specs-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 304</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_specs</span>
  <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">matching_specs</span> <span class="ruby-keyword">true</span>

  <span class="ruby-comment"># TODO: check Gem.activated_spec[self.name] in case matches falls outside</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">specs</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">stubs_for</span> <span class="ruby-identifier">name</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingSpecError</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">requirement</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingSpecVersionError</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">requirement</span>, <span class="ruby-identifier">specs</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># TODO: any other resolver validations should go here</span>

  <span class="ruby-identifier">matches</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">type</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p><a href="Dependency.html"><code>Dependency</code></a> type.</p>

                              <div class="method-source-code" id="type-source">
            <pre><span class="ruby-comment"># File rubygems/dependency.rb, line 160</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">type</span>
  <span class="ruby-ivar">@type</span> <span class="ruby-operator">||=</span> <span class="ruby-value">:runtime</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

